<?php


namespace plugin\onecard\app\controller;


use plugin\admin\app\model\TejianOnecardInfo;
use support\Request;

class OnecardController extends Base
{
    protected $model = null;

    /**
     * 构造函数
     * @return void
     */
    public function __construct()
    {
        $this->model = new TejianOnecardInfo();
    }
    //获取一卡通列表
    public function getOnecard(Request $request)
    {
        $list = $this->model->getOnecard();
//        $list =TejianOnecardInfo::with(['scenic' => function ($query) {
//            $query->select('tejian_scenic.id', 'tejian_scenic.image', 'tejian_scenic.title'); // 假设景区表中有id, image, title字段
//        }])
//            ->get();
        return $this->json(0, 'ok', $list);
    }

}